package com.ironman.compute.consumer;

import com.ironman.event.properties.SysTrainingProperties;
import lombok.extern.slf4j.Slf4j;
import org.dromara.mica.mqtt.core.client.MqttClient;
import org.noear.snack.ONode;

import java.util.function.Consumer;

@Slf4j
public class GpsConsumer extends BaseConsumer implements Consumer<ONode> {

    public GpsConsumer(SysTrainingProperties sysTrainingProperties, MqttClient mqttClient) {
        super(sysTrainingProperties, mqttClient);
    }

    @Override
    public void accept(ONode data) {
        doAccept("gps", data, (topic, dataJson, published) -> log.info("{} {} \n{}", topic, published, dataJson));
    }
}
